package edu.uow.devdocs

class CommentHistoryController {
    static scaffold = true
	def currentUserService
	
	def addCommentHistory() {
		def commentHistoryInstance = new CommentHistory()
		bindData(commentHistoryInstance, params)
		commentHistoryInstance.person = currentUserService.getCurrentUser()
		if (commentHistoryInstance.validate()) {
			commentHistoryInstance.save(flush:true)
			flash.message = message(code: 'default.created.message', args: [message(code: 'CommentHistory.label', default: 'CommentHistory'), commentHistoryInstance.id])
		}
		render(template:"/shared/addComments", 
			model:['commentHistoryInstance':commentHistoryInstance.hasErrors()?commentHistoryInstance:new CommentHistory(),
			'projectId': params?.project?.id,
			'issueId':params?.issue?.id,
			'developmentChecklistId':params?.developmentChecklist?.id,
			'developmentTaskId': params?.developmentTask?.id])
	}
}
